FROM ubuntu:18.04
RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ trusty main universe" >> /etc/apt/sources.list 
RUN apt-get update
RUN apt-get upgrade --assume-yes
 
RUN apt-get install  --assume-yes software-properties-common
RUN add-apt-repository ppa:openjdk-r/ppa
RUN apt-get update

# RUN apt-get install --assume-yes perl

# RUN apt-get update && apt-get install -y sudo

# RUN apt-get install --assume-yes python bc zip u-boot-tools 

ARG user=test

RUN useradd --create-home --no-log-init --shell /bin/bash ${user} \
    && adduser ${user} sudo \
    && echo "${user}:1" | chpasswd


#RUN apt-get   install  --assume-yes  libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dev g++-multilib git flex bison gperf build-essential  \

RUN apt-get   install  --assume-yes   libgl1-mesa-dev g++-multilib git flex bison gperf build-essential  \
              libncurses5-dev  tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev   dpkg-dev libsdl1.2-dev   \
              git-core gnupg flex bison gperf   zip curl zlib1g-dev gcc-multilib g++-multilib  \
              libc6-dev-i386  lib32ncurses5-dev x11proto-core-dev libx11-dev  libgl1-mesa-dev libxml2-utils xsltproc unzip m4 \
              lib32z-dev ccache  libssl-dev  python3 bc cpio rsync unzip zip wget   gnupg flex bison gperf  \
              zip curl zlib1g-dev libc6-dev lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev \
              libgl1-mesa-dev g++-multilib tofrodos  python-markdown libxml2-utils xsltproc vim cgpt uuid-dev  \
              zlib1g-dev gcc-multilib  g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev \
              lib32z-dev libgl1-mesa-dev libxml2-utils xsltproc unzip libncurses5 uuid-dev   \
              u-boot-tools  bc  zip  python  sudo   \
              libxml-simple-perl  mingw32 openjdk-8-jdk   \
	      liblz4-dev  \
	      clang libyaml-dev  libtinfo*  \
	      repo  python-pip
	      
# repo needed by the SC200P 
# pip install pycryptodome  
# 

# qcm8550 Android 13
#  sudo apt-get install openjdk-11-jdk

# RK3568 Android 13             
ADD ./lz4  /usr/bin/

RUN update-alternatives --install /usr/bin/python  python /usr/bin/python2  27001
RUN update-alternatives --install /usr/bin/python  python /usr/bin/python3  3600

# SC200P Android 14
RUN  pip install pycryptodome

# Rockhip need the Python3
# Unisoc need the Python2

USER  ${user}


